<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=yes">

    <meta content="telephone=yes,email=yes" name="format-detection">
    <!--//自动识别电话号码和邮箱-->

    <meta content="yes" name="apple-mobile-web-app-capable">
    <!--//苹果手机：会删除默认的工具栏和菜单栏，网站开启对web app程序的支持-->
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <!--//苹果手机：在web app应用下状态条（屏幕顶部条）的颜色,默认值为default（白色），可以定为black（黑色）和black-translucent（灰色半透明）。-->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <!--//苹果手机：如果把一个web app添加到了主屏幕中，那么从主屏幕中打开这个web app则全屏显示-->
    <link rel="apple-touch-icon" href="images/HTML5_Badge_64.png"/>
    <!--//苹果手机：将应用添加到手机主屏幕，会有一个icon可以直接进入-->
    <title>有收入</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <!--初始化样式-->
    <link rel="stylesheet" href="css/reset.css">
    <!--共用样式-->
    <link rel="stylesheet" href="css/common.css">
    <!--整个网站的局部样式-->
    <link rel="stylesheet" href="css/style.css">
    <!--适配样式-->
    <link rel="stylesheet" href="css/styleMedia.css">
    <style>
        html, body {
            position: relative;
            overflow-x: hidden;

        }
    </style>
    <script src="../../Downloads/us.sitesucker.mac.sitesucker/www.jq22.com/demo/flex布局/flexible.js"></script>
</head>
<body style="background-color: #f4f9fd;">

<!--header begin-->
<header>
    <div id="flexHeader">
        <div class="div1 mui-action-back"><a><img src="images/icon_arrow_left.png"></a></div>
        <div class="div2">已完成垫付任务</div>
        <div class="div3"></div>
    </div>
</header>
<!--header end-->

<!--revoke-time-reason begin-->
<article class="tab">
    <div class="content-incomplete-tasks">
        <div class="wang-tab-content wang-tab-content-1 transition" id="divliList">
            <!--<div class="to-be-operated to-be-operated-item">
                <div>
                    <img src="images/img_taobao.png">
                    <p>2134243</p>
                    <P></P>
                    <P></P>
                    <p>2018-09-20</p>
                </div>
                <div onclick="pageJump(this)" name="taobaoMobileMission_new1">
                    <img src="images/img_shopping_1.png">
                    <div class="revoke-time-reason">
                        <p><span class="revoke-time" style="color: #f2b038">佣金：9.84</span></p>
                        <p><span class="revoke-time" style="font-size: .26rem">垫付79元 &nbsp;&nbsp;&nbsp;普通好评</span></p>
                    </div>
                </div>
            </div>-->
        </div>
    </div>
</article>
<!--revoke-time-reason end-->

<!--js-->
<script src="js/jquery-1.12.3.min.js"></script>
<script src="js/common.js"></script>
<script src="js/mui.min.js"></script>
<script src="js/config.js"></script>

<script>
	$(function(){
		$.ajax({
			url: $CONFIG.baseUrl + "/api/order/getOrderListByType",
			type: 'get',
			data:{
				taskType:0,
				orderStatus:5,
			},
			beforeSend:function(x){
				x.setRequestHeader("Authorization", localStorage.getItem('token'));
			},
			success: function(data){
				var t = "";
				var m = '<div class="to-be-operated to-be-operated-item">\
			                <div>\
			                    <img src="images/#0">\
			                    <p>#1</p>\
			                    <p></p>\
			                    <p></p>\
			                    <p>#2</p>\
			                </div>\
			                <div onclick="goto(#7)">\
			                    <img src="http://tbk.tutew.com/#3">\
			                    <div class="revoke-time-reason">\
			                        <p><span class="revoke-time" style="color: #f2b038">佣金：#4</span></p>\
			                        <p><span class="revoke-time" style="font-size: .26rem">垫付#5元 &nbsp;&nbsp;&nbsp;#6</span></p>\
			                    </div>\
			                </div>\
			            </div>';
			    if (data.data) {
			    	for(var i=0;i<data.data.length;i++){
	                	t += m.replace("#0",function(){
								var x = ''
								switch (data.data[i].platformName){
									case '淘宝':
									  x="icon_taobao.png";
									  break;
									case '阿里巴巴':
									  x="icon_alibaba.png";
									  break;
									case '拼多多':
									  x="icon_pdd.png";
									  break;
									case '美丽说':
									  x="icon_mls.png";
									  break;
									case '京东':
									  x="icon_jd.png";
									  break;
									case '蘑菇街':
									  x="icon_mgj.png";
									  break;
								}
								return x
							})
	                		.replace("#1", data.data[i].orderNum)
			        		.replace("#2", data.data[i].orderCt.substring(0, 10))
			        		.replace("#3", data.data[i].goods1Pic)
			        		.replace("#4", data.data[i].customerReceive)
			        		.replace("#5", data.data[i].realPayPrice)
			        		.replace("#6", function(){
			        			if(data.data[i].hpType == 1) return "普通好评";
			        			if(data.data[i].hpType == 2) return "文字好评";
			        			if(data.data[i].hpType == 3) return "图片好评";
			        			if(data.data[i].hpType == 4) return "视频好评";
			        		})
			        		.replace("#7", data.data[i].orderId)
                	}
			    }
                
               $("#divliList").html(t);
			},
			errror: function(error){
				console.log('error')
			}
		})
	})
</script>

<script>
	function goto(id){
		window.location = "taobaoMobileMission_new.html?orderId=" + id
	}
</script>

</body>
</html>